package com.itheima.Thread07;

import javax.swing.*;
import java.util.concurrent.FutureTask;

public class Demo {
    public static void main(String[] args) {
        MyCallable mc = new MyCallable();
        FutureTask<String> sft = new FutureTask<>(mc);
        Thread th = new Thread(sft);
//        int p = th.getPriority();
//        System.out.println(p);
        th.setPriority(10);
        th.setName("飞机");
        //开启线程
        th.start();

        MyCallable mc1 = new MyCallable();
        FutureTask<String> sft1 = new FutureTask<>(mc1);
        Thread th1 = new Thread(sft1);
//        int p1 = th.getPriority();
//        System.out.println(p1);
        th1.setName("坦克");
        //开启线程
        th1.start();
    }
}



